/********************************************************************************
* EJAF - Community health workers - Community survey cleaning: 							
*
* Created: 21 January 2015
* Last updated: 09 November 2015 
*
* This file:
* 1. Reads in raw data from the population-based survey, checks relevant
*    variables and creates new, relevant variables. Cleaning all variables
* 2. Original variables that have been cleaned are named with a "_lg" suffix
*	 so that users know that there is a cleaned version of that variable that
*	 should be used.
* 3. Note that this file does not drop any observations, but there are
*	 observations that should be removed before analysis. See the analysis
*	 do-file "anejafmain01" for more information on this point.
*
*******************************************************************************/

//version 13.1
clear all
set more off
//qui set mem 300m
//qui set matsize 799
//qui set maxvar 8000
program drop _all

/******************************************
		SELECT Change global serverpath for different users
******************************************/

global serverpath  "/Users/pgeldsetzer/Documents/aa SD/Familia Salama/Data analysis/Final files sent by Elysia"

//capture log close
//log using "$serverpath/log files/crejpop01.txt", replace


/********************************************************************************
	0. Programs used in data cleaning  
*******************************************************************************/

*Program for creating a lg variable from a string variable and a new numeric variable
program tolgstn
 rename `1' `1'_lg
 gen `1' = .
 local vlab: var label `1'_lg
 lab var `1'_lg "Legacy: `vlab'"
 lab var `1' "`vlab'"
 order `1', before(`1'_lg)
end

program tolgnum
 rename `1' `1'_lg
 gen `1' = `1'_lg
 local vlab: var label `1'_lg
 lab var `1'_lg "Legacy: `vlab'"
 lab var `1' "`vlab'"
 order `1', before(`1'_lg)
end


/********************************************************************************
	1. Reading in data   
*******************************************************************************/
clear
import excel "$serverpath/PBSdata2.xlsx", sheet("Washiriki") firstrow 

/********************************************************************************
	2. Variable renaming, labelling, and cleaning
*******************************************************************************/

/*RENAMING variables to simplify. The new variable name is "q" followed by the
question number. */

foreach var of varlist Date1-Age7 {
 local abriev = substr("`var'", -1, 1)
 rename `var' q`abriev'
}


foreach var of varlist RCHCard10-ExpectDelivery21 DateofDelivery22 WhereDeliver23 HFdelivery24-Adult18HH26  Children17yrsHH29-GesationAgeMiscarriage46  SatifiedWithHBC48-SaltUsed54  DrinkAlcMost60-HowTestDone64  OutcomeOfTest65-TreatedGD68  DiagnosedHTN70-WhentoUseFPinFuture100 {
 local abriev = substr("`var'", -2, 2)
 rename `var' q`abriev'
}


/*LABEL vars with the full question*/
lab var q1 "Date"
lab var q2 "Interviewer ID"
lab var q3 "District"
lab var q4 "Ward"
lab var q5 "Street"
lab var q6 "House number"
lab var q7 "Age of woman"
lab var q10 "RCH card number (4 digits)"
lab var q11 "Is the RCH4 card available?"
lab var q12 "Have you attended ANC during your most recent preg b/t Jun '12 & May '14"
lab var q13 "If yes, approx how many months were you preg when attended your first ANC"
lab var q14 "How many times did you attend ANC during this preg"
lab var q15 "Date ANC visit 1"
lab var q16 "Date ANC visit 2"
lab var q17 "Date ANC visit 3"
lab var q18 "Date ANC visit 4"
lab var q19 "Date ANC visit 5"
lab var q20 "Date of last menstual period"
lab var q21 "Where do you intend to deliver"
lab var q22 "If no longer preg, date of delivery or miscarriage from most recent preg"
lab var q23 "If you gave birth, where did you deliver?"
lab var q24 "If delivered at health facility, give name of facility"
lab var q25 "Highest level of education attended"
lab var q26 "# adults 18 or older live in household" 
lab var q29 "# of children 17 or younger live in household"
lab var q30 "Has your household ever been visited by a HBC"
lab var q31 "How many times was the household visited by an HBC"
lab var q32 "What was the approx date of the last HBC visit"
lab var q33 "Have you been preg at any time b/t June 2012 & May 2014?"
lab var q34 "# of women who live in your hh have been preg since June 2012"
lab var q35 "# of women who live in hh gave birth (w/out miscarriage) since July 2012"
lab var q36 "# of women who live in hh had a miscarriage since July 2012"
lab var q37 "# of months preg should a wmn attend her first ANC visit"
lab var q38 "# times should a wmn attend ANC during her preg"
lab var q39 "Is it possible for a baby to be born HIV-positive"
lab var q40 "If yes, what are the reasons babies become HIV infected"
lab var q41 "Where is it recommended for a preg woman to deliver"
lab var q42 "What feeding method is rec for newborns for first 6 months"
lab var q43 "Do you think preg women should get tested for HIV"
lab var q44 "If yes, why"
lab var q45 "What is the date of your miscarriage"
lab var q46 "Approx how many months were you when miscar occured"
rename SatisfiedWithHS q47
lab var q47 "Overall, how satisfied are you with the public health care system in DSM"
lab var q48 "How satisfied are you with the HBC program"
lab var q49 "In last 12 months, since July 2012, hungry but didn't eat"
lab var q50 "In last 12 months, since July 2012, eat less than should"
lab var q51 "In last 12 months, since July 2012, family cut size of meals"
lab var q52 "In last 12 months, since July 2012, family skip meals"
lab var q53 "If yes, how often did this happen"
lab var q54 "Salt is iodized or not"
*More questions that have not been labeled/cleaned, because we are not using them yet


/*CLEANING variables - String to numeric and fixing poor data entry (shifting)*/
*id - removing the / to make a numeric id number
gen id = regexs(1) if regexm(ID, "^[0-9]")

*cleaning district
rename q3 q3_lg
gen district = .
lab var district "District, cleaned from q3"
order district, before(q3_lg)
lab def district 1 "Ilala" 0 "Kinondoni"
lab val district district

foreach val in ILALA ILALAL IALALA ILAILA ILALAKINYEREZI ILALAL ILLALA {
  recode district (.=1) if q3_lg == "`val'"
}

foreach val in KINDONDONI KINDONI KININDONI KINONDDONI KINONDINI KINONDO KINONDOI KINONDON KINONDONI KINONNDONI KIONDONI KNONDONI Kinondoni kinondoni{
  recode district (.=0) if q3_lg == "`val'"
}

recode district (.=0) if q3_lg == "KINONDON I"
  
recode district (.=1) if q3_lg == "UPANGA MASHARIKI" | q2 == "ILALA" 
recode district (.=0) if q2 == "KINONDONI" 
recode district (.=0) if q4 == "MSIGANI" | q3_lg == "MAKUMBUSHO" | q3_lg == "KIBAMBA" | q3_lg == "BUNJU"  | q3_lg == "MAGOMENI"
recode district (.=1) if q3_lg == "KALA" | q3_lg == "MSONGOLA" | q3_lg == "CHANIKA" | q3_lg == "KINYEREZI" | q4 == "ILALA"
recode district (.=0) if q3_lg == "KIJITONYAMA" | q4 == "KINONDONI" | q3_lg == "TANDALE"
recode district (.=1) if q4 == "MSONGOLA"

*cleaning Ward
rename q4 q4_lg
gen ward = .
lab var ward "Ward, cleaned from q4"
order ward, before(q4_lg)
lab def ward 1 "Buguruni" 2 "Bunju" 3 "Chanika" 4 "Gerezani" 5 "Goba" ///
   6 "Hananasif" 7 "Ilala" 8 "Jangwani" 9 "Kariakoo" 10 "Kawe" 11 "Kibamba" ///
   12 "Kigogo" 13 "Kijitonyama" 14 "Kimanga" 15 "Kimara" 16 "Kinondoni" ///
   17 "Kinyerezi" 18 "Kipawa" 19 "Kisutu" 20 "Kitunda" 21 "Kivukoni" ///
   22 "Kivule" 23 "Kiwalani" 24 "Kunduchi" 25 "Kwembe" 26 "Mabibo" ///
   27 "Mabwepande" 28 "Magomeni" 29 "Majohe" 30 "Makongo" 31 "Makuburi" ///
   32 "Makumbusho" 33 "Makurumla" 34 "Manzese" 35 "Mbezi" 36 "Mbezi juu" ///
   37 "Mburahati" 38 "Mbweni" 39 "Mchafukoge" 40 "Mchikichini" 41 "Mikocheni" ///
   42 "Msasani" 43 "Msigani" 44 "Msongola" 45 "Mwananyamala" 46 "Mzimuni" ///
   47 "Ndugumbi" 48 "Pugu" 49 "Saranga" 50 "Segerea" 51 "Sinza" 52 "Tabata" ///
   53 "Tandale" 54 "Ubungo" 55 "Ukonga" 56 "Upanga Magharibi" ///
   57 "Upanga Mashariki" 58 "Vingunguti" 59 "Wazo"
lab val ward ward

recode ward (.=1) if q4_lg == "BUGURUNI"
recode ward (.=2) if q4_lg == "BUNJU"
recode ward (.=3) if q4_lg == "CHANIKA"
recode ward (.=4) if q4_lg == "GEREZANI"
recode ward (.=5) if q4_lg == "GOBA"
recode ward (.=6) if q4_lg == "HANANASIF"
recode ward (.=7) if q4_lg == "ILALA"
recode ward (.=8) if q4_lg == "JANGWANI"
recode ward (.=9) if q4_lg == "KARIAKOO"
recode ward (.=10) if q4_lg == "KAWE"
recode ward (.=11) if q4_lg == "KIBAMBA"
recode ward (.=12) if q4_lg == "KIGOGO"
recode ward (.=13) if q4_lg == "KIJITONYAMA"
recode ward (.=14) if q4_lg == "KIMANGA"
recode ward (.=15) if q4_lg == "KIMARA"
recode ward (.=16) if q4_lg == "KINONDONI"
recode ward (.=17) if q4_lg == "KINYEREZI"
recode ward (.=18) if q4_lg == "KIPAWA"
recode ward (.=19) if q4_lg == "KISUTU"
recode ward (.=20) if q4_lg == "KITUNDA"
recode ward (.=21) if q4_lg == "KIVUKONI"
recode ward (.=22) if q4_lg == "KIVULE"
recode ward (.=23) if q4_lg == "KIWALANI"
recode ward (.=24) if q4_lg == "KUNDUCHI"
recode ward (.=25) if q4_lg == "KWEMBE"
recode ward (.=26) if q4_lg == "MABIBO"
recode ward (.=27) if q4_lg == "MABWEPANDE"
recode ward (.=28) if q4_lg == "MAGOMENI"
recode ward (.=29) if q4_lg == "MAJOHE"
recode ward (.=30) if q4_lg == "MAKONGO"
recode ward (.=31) if q4_lg == "MAKUBURI"
recode ward (.=32) if q4_lg == "MAKUMBUSHO"
recode ward (.=33) if q4_lg == "MAKURUMLA"
recode ward (.=34) if q4_lg == "MANZESE"
recode ward (.=35) if q4_lg == "MBEZI"
recode ward (.=36) if q4_lg == "MBEZI JUU"
recode ward (.=37) if q4_lg == "MBURAHATI"
recode ward (.=38) if q4_lg == "MBWENI"
recode ward (.=39) if q4_lg == "MCHAFUKOGE"
recode ward (.=40) if q4_lg == "MCHIKICHINI"
recode ward (.=41) if q4_lg == "MIKOCHENI"
recode ward (.=42) if q4_lg == "MSASANI"
recode ward (.=43) if q4_lg == "MSIGANI"
recode ward (.=44) if q4_lg == "MSONGOLA"
recode ward (.=45) if q4_lg == "MWANANYAMALA"
recode ward (.=46) if q4_lg == "MZIMUNI"
recode ward (.=47) if q4_lg == "NDUGUMBI"
recode ward (.=48) if q4_lg == "PUGU"
recode ward (.=49) if q4_lg == "SARANGA"
recode ward (.=50) if q4_lg == "SEGEREA"
recode ward (.=51) if q4_lg == "SINZA"
recode ward (.=52) if q4_lg == "TABATA"
recode ward (.=53) if q4_lg == "TANDALE"
recode ward (.=54) if q4_lg == "UBUNGO"
recode ward (.=55) if q4_lg == "UKONGA"
recode ward (.=56) if q4_lg == "UPANGA MAGHARIBI"
recode ward (.=57) if q4_lg == "UPANGA MASHARIKI"
recode ward (.=58) if q4_lg == "VINGUNGUTI"
recode ward (.=59) if q4_lg == "WAZO"

recode ward (.= 42) if q3_lg == "MSASANI"
recode ward (.= 57) if q3_lg == "UPANGA MSHARIKI"
recode ward (.= 17) if q3_lg == "ILALAKINYEREZI" | q3_lg == "KINYEREZI"
recode ward (.= 48) if q5 == "PUGU" | q3_lg == "PUGU"
recode ward (.= 3) if q5 == "LUBAKAYA" | q4_lg == "CHANAIKA"
recode ward (.= 38) if q4_lg == "BWENI"
recode ward (.= 2) if q3_lg == "BUNJU"
recode ward (.=6) if q4_lg == "HANANASIFU"
recode ward (.= 40) if q4_lg == "ILALAMCHIKICHINI"
recode ward (.= 9) if q4_lg == "K-KOO" | q4_lg == "K/KOO" | q3_lg == "KKOO" | q4_lg == "KKOO" | q4_lg == "KARIAKOO MAGHARIBI"
recode ward (.=45) if q4_lg == "KAMBANGWA"
recode ward (.=14) if q4_lg == "KIAMNGA"
recode ward (.=31) if q5 == "MAKUBURI"
recode ward (.=33) if q4_lg == "MAKRUMLA" | q4_lg == "MAKULUMLA" | q4_lg == "MAKUMILA" | q4_lg == "MAKURIMLA" | q4_lg == "MAKURUMIA" | q4_lg == "MAKURUMULA" | q4_lg == "MAKURUMURA"
recode ward (.=34) if q4_lg == "MANZASE" | q4_lg == "MANZENSE"
recode ward (.=55) if q3_lg == "UKONGA"
recode ward (.=41) if q4_lg == "MIKOCFHENI"
recode ward (.=29) if q3_lg == "MAJOHE" | q4_lg == "MJI MPYA" | q4_lg == "MMAJOHE"
recode ward (.=8) if q5 == "JANGWANI"
recode ward (.=43) if q4_lg == "MSICIANI"
recode ward (.=45) if q4_lg == "MSISIRI"
recode ward (.=44) if q4_lg == "MSOMGOLA" | q4_lg == "MSONGORA" | q4_lg == "MSONGORWA"
recode ward (.=58) if q3_lg == "VINGUNGUTI"
recode ward (.=45) if q4_lg == "MWANNYAMALA"
recode ward (.=47) if q4_lg == "NDUNGUMBI"
recode ward (.=48) if q4_lg == "PUGU BOMBANI"
recode ward (.=49) if q4_lg == "SALANGA"
recode ward (.=44) if q3_lg == "MSONNGOLA"
recode ward (.=57) if q4_lg == "UPANAGA EAST" | q4_lg == "UPANAGA MASHARIKI"
recode ward (.=57) if q4_lg == "UPANGA" & q5 == "KIBASILA"
recode ward (.=57) if q4_lg == "UPANGA" & q5 == "KITONGA"
recode ward (.= 57) if q4_lg == "UPANGA  MASHARIKI"
recode ward (.=3) if q3_lg == "CHANIKA"
recode ward (.=58) if q4_lg == "VINGUNGUTU" | q4_lg == "VINGUTI"
recode ward (.=59) if q4_lg == "WAZ0"
recode ward (.=13) if q4_lg == "kijitonyama"
recode ward (.=51) if q4_lg == "sinza"
recode ward (.=27) if q4_lg == "MABWE PANDE"
recode ward (.=1) if q4_lg == "BUGURUNI MALAPA"
recode ward (.=11) if q4_lg == "KIBANDA"
recode ward (.= 57) if q3_lg == "UPANGA MASHARIKI" & q4_lg == "KIBASIRA"
recode ward (.=29) if q4_lg == "KICHANGANI MAJOHE"
recode ward (.=11) if q3_lg == "KIBAMBA" & q4_lg == "KILUVYA"
recode ward (.=11) if q4_lg == "KIMBAMBA" & q5 == "KILUVYA"
recode ward (.=11) if q4_lg == "KIRAMBA" & q5 == "KILUVYA"
recode ward (.=32) if q3_lg == "MAKUMBUSHO"
recode ward (.=44) if q3_lg == "MSONGOLA"
recode ward (.=20) if q3_lg == "KITUNDA"
recode ward (.=23) if q4_lg == "KIWALA"
recode ward (.=14) if q5 == "KIMANGA DARAJANI"
recode ward (.=40) if q5 == "MCHIKICHINI" | q5 == "MCHIKICHI"
recode ward (.=10) if q4_lg == "Kawe"
recode ward (.=31) if q4_lg == "MAAKUBURI"
recode ward (.=27) if q4_lg == "MABULE PANDE"
recode ward (.=29) if q4_lg == "MAGOJE" | q4_lg == "MAJOHO"
recode ward (.=28) if q4_lg == "MAGOMENI MAKUTI"
recode ward (.=34) if q4_lg == "MANZASE" | q4_lg == "MANZENSE"

recode ward (35=11) if q5 == "HONDOKO"
recode ward (.=11) if q4_lg == "MBEZI KIBAMBA" & q5 == "HONDOKO"
recode ward (.=11) if q4_lg == "KIBAHA" & q2 == "ISSA SELEMANI KASHINDE"

*cleaning Street
rename q5 q5_lg
gen street = .
lab var street "Street, cleaned from q5"
order street, before(q5_lg)

lab def street 100 "Kisiwani" 101 "Madenge" 102 "Malapa" 103 "Mnyamani" 104 /// 
	"Basihaya" 105 "Boko" 106 "Bunju A" 107 "Dovya" 108 "Kilungule" 109 ///
	"Kimwani" 110 "Lubakaya" 111 "Lukooni" 112 "Nzasa" 113 "Tunguni" 114 ///
	"Vikongolo" 115 "Yongwe" 116 "Zingiziwa" 117 "Gerezani Magharibi" 118 ///
	"Gerezani Mashariki" 119 "Goba" 120 "Kinzudi" 121 "Kulangwa" 122 "Matosa" ///
	123 "Hananasif" 124 "Kisutu" 125 "Mkunguni A" 126 "Mkunguni B" 127 ///
	"Karume" 128 "Kasulu" 129 "Mafuriko" 130 "Shariff Shamba" 131 ///
	"Mnazi Mmoja" 132 "Mtambani" 133 "Mtambani A" 134 "Ukombzi" 135 ///
	"Kariakoo kaskazini" 136 "Kariakoo Magharibi" 137 "Kariakoo Mashariki" ///
	138 "Mbezi beach A" 139 "Mbezi beach B" 140 "Mzimuni" 141 "Ukwamani" ///
	142 "Gogoni" 143 "Hondogo" 144 "Kibamba" 145 "Kibwegere" 146 "Kiluvya" ///
	147 "Kigogo kati" 148 "Kigogo Mkwajuni" 149 "Mbuyuni" 150 "Aliamua B" ///
	151 "Alimaua A" 152 "Bwawani" 153 "Kijitonyama" 154 "Mpakani A" 155 ///
	"Mpakani B" 156 "Mwenge" 157 "Darajani" 158 "Kimanga" 159 "Kisukuru" ///
	160 "Tembomgwaza" 161 "Baruti" 162 "Golani" 163 "Kilungule A" 164 ///
	"Kilungule B" 165 "Kimara baruti" 166 "Mavurunza" 167 "Ada Estate" ///
	168 "Kinondoni  Mjini" 169 "Kinondoni Shamba" 170 "Kumbukumbu" 171 ///
	"Bonyokwa" 172 "Kifuru" 173 "Kinyerezi" 174 "Karakata" 175 "Kipunguni" ///
	176 "Mogo" 177 "Kisutu" 178 "Mtendeni" 179 "Kitunda kati" 180 "Mzinga" ///
	181 "Kivukoni" 182 "Sea View" 183 "G/Mboto" 184 "Guluka kwalala" 185 ///
	"Kipunguni B" 186 "Kivule" 187 "Ulongoni" 189 "Kigilagila" 190 ///
	"Kiwalani" 191 "Minazi Mirefu" 192 "Yombo" 193 "Kilongawima" 194 ///
	"Kondo" 195 "Mtongani" 196 "Pwani" 197 "Tegeta" 198 "Ununio" 199 ///
	"King'azi" 200 "Kisopwa" 201 "Kwembe" 202 "Luguruni" 203 "Mpakani" ///
	204 "Azimio" 205 "Jitegemee" 206 "Kanuni" 207 "Mabibo" 208 ///
	"Mabibo Farasi" 209 "Matokeo" 210 "Bunju B" 211 "Mabwepande" 212 ///
	"Mbopo" 213 "Dossi" 214 "Idrisa" 215 "Makuti A" 216 "Makuti B" 217 ///
	"Suna" 218 "Kichangani" 219 "Kigezi" 220 "Kivule" 221 "Mgeule" 222 ///
	"Mji Mpya" 223 "Nyeburu" 224 "Zavala" 225 "Changanyikeni" 226 "Makongo" ///
	227 "Mbuyuni" 228 "Mlalakuwa" 229 "Kajima" 230 "Kibangu" 231 "Makoka" ///
	232 "Makuburi" 233 "Mwongozo" 234 "Kisiwani" 235 "Makumbusho" 236 ///
	"Mbuyuni" 237 "Mchangani" 238 "Minazini" 239 "Kagera" 240 "Kilimahewa" ///
	241 "Kimamba" 242 "Kwa jongo" 243 "Mianzini" 244 "Sisi kwa sisi" 245 ///
	"Chakula bora" 246 "Kilimani" 247 "Midizini" 248 "Mnazimmoja" 249 ///
	"Muungano" 250 "Mvuleni" 251 "Mwembeni" 252 "Uzuri" 253 "Makabe" 254 ///
	"Mbezi Luis" 255 "Mpiji magohe" 256 "Msakuzi" 257 "Mshikamano" 258 ///
	"Msumi" 259 "Jogoo" 260 "Mbezi juu" 261 "Mbezi kati" 262 "Mbezi mtoni" ///
	263 "Ndumbwi" 264 "Barafu" 265 "Kisiwani" 266 "NHC" 267 "Maputo" 268 ///
	"Mbweni" 269 "Mpiji" 270 "Kitumbini" 271 "Mchafukoge" 272 "Ilala Kota" ///
	273 "Mission Quarter" 274 "Msimbazi Bondeni" 275 "Ally Hassan Mwinyi" ///
	276 "Darajani" 277 "Mikocheni A" 278 "Mikocheni B" 279 "Regent Estate" ///
	280 "TPDC" 281 "Bonde la Mpunga" 282 "Makangira" 283 "Masaki" 284 ///
	"Mikoroshini" 285 "Oysterbay" 286 "Kwa Yusufu" 287 "Malamba mawili" ///
	288 "Msigani" 289 "Temboni" 290 "Kiboga" 291 "Kidole" 292 "Kitonga" ///
	293 "Mbondole" 294 "Mkera" 295 "Mvuleni" 296 "Sangara" 297 ///
	"Uwanja wa nyani" 298 "Yangeyange" 299 "Bwawani" 300 "Kambangwa" ///
	301 "Kwa kopa" 302 "Msisiri A" 303 "Msisiri B" 304 "Msolomi" 305 ///
	"Mwinjuma" 306 "Idrissa" 307 "Makumbusho" 308 "Mtambani" 309 ///
	"Mwinyimkuu" 310 "Kagera Mikoroshini" 311 "Makanya" 312 "Mpakani" ///
	313 "Vigaeni" 314 "Bangulo" 315 "Bombani" 316 "Kichangani" 317 ///
	"Kigogo fresh" 318 "Kinyamwezi" 319 "Pugu station" 320 "Kimara B" ///
	321 "King'ongo" 322 "Matangini" 323 "Michungwani" 324 "Saranga" ///
	325 "Stopover" 326 "Upendo" 327 "Amani" 328 "Liwiti" 329 "Migombani" ///
	330 "Segerea" 331 "Ugombolwa" 332 "Sinza A" 333 "Sinza B" 334 "Sinza C" ///
	335 "Sinza D" 336 "Sinza E" 337 "Mandela" 338 "Matumbi" 339 "Msimbazi" ///
	340 "Tabata" 341 "Tabata kisiwani" 342 "Tenge" 343 "Kwa Mkunduge" 344 ///
	"Kwa Mtogole" 345 "Kwa Pakacha" 346 "Kwa Tumbo" 347 "Muhalitani" 348 ///
	"Sokoni" 349 "Chuo kikuu" 350 "Kibo" 351 "Kisiwani" 352 "Msewe" ///
	353 "NHC" 354 "Markaz" 355 "Mazizini" 356 "Mongo la ndege" 357 ///
	"Mwembe Madafu" 358 "Charambe" 359 "Fire" 360 "Mfaume" 361 "Kibasila" ///
	362 "Kitonga" 363 "Kombo" 364 "Miembeni" 365 "Mtakuja" 366 "Mtambani" ///
	367 "Kilimahewa" 368 "Kisanga" 369 "Madala" 370 "Mivumoni" 371 "Salasala" ///
	372 "Wazo"  

lab val street street


recode street (.=100) if q5_lg == "KISIWANI" & q4_lg == "BUGURUNI"
recode street (.=101) if q5_lg == "MADENGE" & q4_lg == "BUGURUNI"
recode street (.=102) if q5_lg == "MALAPA" & q4_lg == "BUGURUNI"
recode street (.=103) if q5_lg == "MNYAMANI" & q4_lg == "BUGURUNI"
recode street (.=104) if q5_lg == "BASIHAYA" & q4_lg == "BUNJU"
recode street (.=105) if q5_lg == "BOKO" & q4_lg == "BUNJU"
recode street (.=106) if q5_lg == "BUNJU A" & q4_lg == "BUNJU"
recode street (.=107) if q5_lg == "DOVYA" & q4_lg == "BUNJU"
recode street (.=108) if q5_lg == "KILUNGULE" & q4_lg == "BUNJU"
recode street (.=109) if q5_lg == "KIMWANI" & q4_lg == "CHANIKA"
recode street (.=110) if q5_lg == "LUBAKAYA" & q4_lg == "CHANIKA"
recode street (.=111) if q5_lg == "LUKOONI" & q4_lg == "CHANIKA"
recode street (.=112) if q5_lg == "NZASA" & q4_lg == "CHANIKA"
recode street (.=113) if q5_lg == "TUNGUNI" & q4_lg == "CHANIKA"
recode street (.=114) if q5_lg == "VIKONGOLO" & q4_lg == "CHANIKA"
recode street (.=115) if q5_lg == "YONGWE" & q4_lg == "CHANIKA"
recode street (.=116) if q5_lg == "ZINGIZIWA" & q4_lg == "CHANIKA"
recode street (.=117) if q5_lg == "GEREZANI MAGHARIBI" & q4_lg == "GEREZANI"
recode street (.=118) if q5_lg == "GEREZANI MASHARIKI" & q4_lg == "GEREZANI"
recode street (.=119) if q5_lg == "GOBA" & q4_lg == "GOBA"
recode street (.=120) if q5_lg == "KINZUDI" & q4_lg == "GOBA"
recode street (.=121) if q5_lg == "KULANGWA" & q4_lg == "GOBA"
recode street (.=122) if q5_lg == "MATOSA" & q4_lg == "GOBA"
recode street (.=123) if q5_lg == "HANANASIF" & q4_lg == "HANANASIF"
recode street (.=124) if q5_lg == "KISUTU" & q4_lg == "HANANASIF"
recode street (.=125) if q5_lg == "MKUNGUNI A" & q4_lg == "HANANASIF"
recode street (.=126) if q5_lg == "MKUNGUNI B" & q4_lg == "HANANASIF"
recode street (.=127) if q5_lg == "KARUME" & q4_lg == "ILALA"
recode street (.=128) if q5_lg == "KASULU" & q4_lg == "ILALA"
recode street (.=129) if q5_lg == "MAFURIKO" & q4_lg == "ILALA"
recode street (.=130) if q5_lg == "SHARIFF SHAMBA" & q4_lg == "ILALA"
recode street (.=131) if q5_lg == "MNAZI MMOJA" & q4_lg == "JANGWANI"
recode street (.=132) if q5_lg == "MTAMBANI" & q4_lg == "JANGWANI"
recode street (.=133) if q5_lg == "MTAMBANI A" & q4_lg == "JANGWANI"
recode street (.=134) if q5_lg == "UKOMBZI" & q4_lg == "JANGWANI"
recode street (.=135) if q5_lg == "KARIAKOO KASKAZINI" & q4_lg == "KARIAKOO"
recode street (.=136) if q5_lg == "KARIAKOO MAGHARIBI" & q4_lg == "KARIAKOO"
recode street (.=137) if q5_lg == "KARIAKOO MASHARIKI" & q4_lg == "KARIAKOO"
recode street (.=138) if q5_lg == "MBEZI BEACH A" & q4_lg == "KAWE"
recode street (.=139) if q5_lg == "MBEZI BEACH B" & q4_lg == "KAWE"
recode street (.=140) if q5_lg == "MZIMUNI" & q4_lg == "KAWE"
recode street (.=141) if q5_lg == "UKWAMANI" & q4_lg == "KAWE"
recode street (.=142) if q5_lg == "GOGONI" & q4_lg == "KIBAMBA"
recode street (.=143) if q5_lg == "HONDOGO" & q4_lg == "KIBAMBA"
recode street (.=144) if q5_lg == "KIBAMBA" & q4_lg == "KIBAMBA"
recode street (.=145) if q5_lg == "KIBWEGERE" & q4_lg == "KIBAMBA"
recode street (.=146) if q5_lg == "KILUVYA" & q4_lg == "KIBAMBA"
recode street (.=147) if q5_lg == "KIGOGO KATI" & q4_lg == "KIGOGO"
recode street (.=148) if q5_lg == "KIGOGO MKWAJUNI" & q4_lg == "KIGOGO"
recode street (.=149) if q5_lg == "MBUYUNI" & q4_lg == "KIGOGO"
recode street (.=150) if q5_lg == "ALIAMUA B" & q4_lg == "KIJITONYAMA"
recode street (.=151) if q5_lg == "ALIMAUA A" & q4_lg == "KIJITONYAMA"
recode street (.=152) if q5_lg == "BWAWANI" & q4_lg == "KIJITONYAMA"
recode street (.=153) if q5_lg == "KIJITONYAMA" & q4_lg == "KIJITONYAMA"
recode street (.=154) if q5_lg == "MPAKANI A" & q4_lg == "KIJITONYAMA"
recode street (.=155) if q5_lg == "MPAKANI B" & q4_lg == "KIJITONYAMA"
recode street (.=156) if q5_lg == "MWENGE" & q4_lg == "KIJITONYAMA"
recode street (.=157) if q5_lg == "DARAJANI" & q4_lg == "KIMANGA"
recode street (.=158) if q5_lg == "KIMANGA" & q4_lg == "KIMANGA"
recode street (.=159) if q5_lg == "KISUKURU" & q4_lg == "KIMANGA"
recode street (.=160) if q5_lg == "TEMBOMGWAZA" & q4_lg == "KIMANGA"
recode street (.=161) if q5_lg == "BARUTI" & q4_lg == "KIMARA"
recode street (.=162) if q5_lg == "GOLANI" & q4_lg == "KIMARA"
recode street (.=163) if q5_lg == "KILUNGULE A" & q4_lg == "KIMARA"
recode street (.=164) if q5_lg == "KILUNGULE B" & q4_lg == "KIMARA"
recode street (.=165) if q5_lg == "KIMARA BARUTI" & q4_lg == "KIMARA"
recode street (.=166) if q5_lg == "MAVURUNZA" & q4_lg == "KIMARA"
recode street (.=167) if q5_lg == "ADA ESTATE" & q4_lg == "KINONDONI"
recode street (.=168) if q5_lg == "KINONDONI  MJINI" & q4_lg == "KINONDONI"
recode street (.=169) if q5_lg == "KINONDONI SHAMBA" & q4_lg == "KINONDONI"
recode street (.=170) if q5_lg == "KUMBUKUMBU" & q4_lg == "KINONDONI"
recode street (.=171) if q5_lg == "BONYOKWA" & q4_lg == "KINYEREZI"
recode street (.=172) if q5_lg == "KIFURU" & q4_lg == "KINYEREZI"
recode street (.=173) if q5_lg == "KINYEREZI" & q4_lg == "KINYEREZI"
recode street (.=174) if q5_lg == "KARAKATA" & q4_lg == "KIPAWA"
recode street (.=175) if q5_lg == "KIPUNGUNI" & q4_lg == "KIPAWA"
recode street (.=176) if q5_lg == "MOGO" & q4_lg == "KIPAWA"
recode street (.=177) if q5_lg == "KISUTU" & q4_lg == "KISUTU"
recode street (.=178) if q5_lg == "MTENDENI" & q4_lg == "KISUTU"
recode street (.=179) if q5_lg == "KITUNDA KATI" & q4_lg == "KITUNDA"
recode street (.=180) if q5_lg == "MZINGA" & q4_lg == "KITUNDA"
recode street (.=181) if q5_lg == "KIVUKONI" & q4_lg == "KIVUKONI"
recode street (.=182) if q5_lg == "SEA VIEW" & q4_lg == "KIVUKONI"
recode street (.=183) if q5_lg == "G/MBOTO" & q4_lg == "KIVULE"
recode street (.=184) if q5_lg == "GULUKA KWALALA" & q4_lg == "KIVULE"
recode street (.=185) if q5_lg == "KIPUNGUNI B" & q4_lg == "KIVULE"
recode street (.=186) if q5_lg == "KIVULE" & q4_lg == "KIVULE"
recode street (.=187) if q5_lg == "ULONGONI" & q4_lg == "KIVULE"
recode street (.=189) if q5_lg == "KIGILAGILA" & q4_lg == "KIWALANI"
recode street (.=190) if q5_lg == "KIWALANI" & q4_lg == "KIWALANI"
recode street (.=191) if q5_lg == "MINAZI MIREFU" & q4_lg == "KIWALANI"
recode street (.=192) if q5_lg == "YOMBO" & q4_lg == "KIWALANI"
recode street (.=193) if q5_lg == "KILONGAWIMA" & q4_lg == "KUNDUCHI"
recode street (.=194) if q5_lg == "KONDO" & q4_lg == "KUNDUCHI"
recode street (.=195) if q5_lg == "MTONGANI" & q4_lg == "KUNDUCHI"
recode street (.=196) if q5_lg == "PWANI" & q4_lg == "KUNDUCHI"
recode street (.=197) if q5_lg == "TEGETA" & q4_lg == "KUNDUCHI"
recode street (.=198) if q5_lg == "UNUNIO" & q4_lg == "KUNDUCHI"
recode street (.=199) if q5_lg == "KINGAZI" & q4_lg == "KWEMBE"
recode street (.=200) if q5_lg == "KISOPWA" & q4_lg == "KWEMBE"
recode street (.=201) if q5_lg == "KWEMBE" & q4_lg == "KWEMBE"
recode street (.=202) if q5_lg == "LUGURUNI" & q4_lg == "KWEMBE"
recode street (.=203) if q5_lg == "MPAKANI" & q4_lg == "KWEMBE"
recode street (.=204) if q5_lg == "AZIMIO" & q4_lg == "MABIBO"
recode street (.=205) if q5_lg == "JITEGEMEE" & q4_lg == "MABIBO"
recode street (.=206) if q5_lg == "KANUNI" & q4_lg == "MABIBO"
recode street (.=207) if q5_lg == "MABIBO" & q4_lg == "MABIBO"
recode street (.=208) if q5_lg == "MABIBO FARASI" & q4_lg == "MABIBO"
recode street (.=209) if q5_lg == "MATOKEO" & q4_lg == "MABIBO"
recode street (.=210) if q5_lg == "BUNJU B" & q4_lg == "MABWEPANDE"
recode street (.=211) if q5_lg == "MABWEPANDE" & q4_lg == "MABWEPANDE"
recode street (.=212) if q5_lg == "MBOPO" & q4_lg == "MABWEPANDE"
recode street (.=213) if q5_lg == "DOSSI" & q4_lg == "MAGOMENI"
recode street (.=214) if q5_lg == "IDRISA" & q4_lg == "MAGOMENI"
recode street (.=215) if q5_lg == "MAKUTI A" & q4_lg == "MAGOMENI"
recode street (.=216) if q5_lg == "MAKUTI B" & q4_lg == "MAGOMENI"
recode street (.=217) if q5_lg == "SUNA" & q4_lg == "MAGOMENI"
recode street (.=218) if q5_lg == "KICHANGANI" & q4_lg == "MAJOHE"
recode street (.=219) if q5_lg == "KIGEZI" & q4_lg == "MAJOHE"
recode street (.=220) if q5_lg == "KIVULE" & q4_lg == "MAJOHE"
recode street (.=221) if q5_lg == "MGEULE" & q4_lg == "MAJOHE"
recode street (.=222) if q5_lg == "MJI MPYA" & q4_lg == "MAJOHE"
recode street (.=223) if q5_lg == "NYEBURU" & q4_lg == "MAJOHE"
recode street (.=224) if q5_lg == "ZAVALA" & q4_lg == "MAJOHE"
recode street (.=225) if q5_lg == "CHANGANYIKENI" & q4_lg == "MAKONGO"
recode street (.=226) if q5_lg == "MAKONGO" & q4_lg == "MAKONGO"
recode street (.=227) if q5_lg == "MBUYUNI" & q4_lg == "MAKONGO"
recode street (.=228) if q5_lg == "MLALAKUWA" & q4_lg == "MAKONGO"
recode street (.=229) if q5_lg == "KAJIMA" & q4_lg == "MAKUBURI"
recode street (.=230) if q5_lg == "KIBANGU" & q4_lg == "MAKUBURI"
recode street (.=231) if q5_lg == "MAKOKA" & q4_lg == "MAKUBURI"
recode street (.=232) if q5_lg == "MAKUBURI" & q4_lg == "MAKUBURI"
recode street (.=233) if q5_lg == "MWONGOZO" & q4_lg == "MAKUBURI"
recode street (.=234) if q5_lg == "KISIWANI" & q4_lg == "MAKUMBUSHO"
recode street (.=235) if q5_lg == "MAKUMBUSHO" & q4_lg == "MAKUMBUSHO"
recode street (.=236) if q5_lg == "MBUYUNI" & q4_lg == "MAKUMBUSHO"
recode street (.=237) if q5_lg == "MCHANGANI" & q4_lg == "MAKUMBUSHO"
recode street (.=238) if q5_lg == "MINAZINI" & q4_lg == "MAKUMBUSHO"
recode street (.=239) if q5_lg == "KAGERA" & q4_lg == "MAKURUMLA"
recode street (.=240) if q5_lg == "KILIMAHEWA" & q4_lg == "MAKURUMLA"
recode street (.=241) if q5_lg == "KIMAMBA" & q4_lg == "MAKURUMLA"
recode street (.=242) if q5_lg == "KWA JONGO" & q4_lg == "MAKURUMLA"
recode street (.=243) if q5_lg == "MIANZINI" & q4_lg == "MAKURUMLA"
recode street (.=244) if q5_lg == "SISI KWA SISI" & q4_lg == "MAKURUMLA"
recode street (.=245) if q5_lg == "CHAKULA BORA" & q4_lg == "MANZESE"
recode street (.=246) if q5_lg == "KILIMANI" & q4_lg == "MANZESE"
recode street (.=247) if q5_lg == "MIDIZINI" & q4_lg == "MANZESE"
recode street (.=248) if q5_lg == "MNAZIMMOJA" & q4_lg == "MANZESE"
recode street (.=249) if q5_lg == "MUUNGANO" & q4_lg == "MANZESE"
recode street (.=250) if q5_lg == "MVULENI" & q4_lg == "MANZESE"
recode street (.=251) if q5_lg == "MWEMBENI" & q4_lg == "MANZESE"
recode street (.=252) if q5_lg == "UZURI" & q4_lg == "MANZESE"
recode street (.=253) if q5_lg == "MAKABE" & q4_lg == "MBEZI"
recode street (.=254) if q5_lg == "MBEZI LUIS" & q4_lg == "MBEZI"
recode street (.=255) if q5_lg == "MPIJI MAGOHE" & q4_lg == "MBEZI"
recode street (.=256) if q5_lg == "MSAKUZI" & q4_lg == "MBEZI"
recode street (.=257) if q5_lg == "MSHIKAMANO" & q4_lg == "MBEZI"
recode street (.=258) if q5_lg == "MSUMI" & q4_lg == "MBEZI"
recode street (.=259) if q5_lg == "JOGOO" & q4_lg == "MBEZI JUU"
recode street (.=260) if q5_lg == "MBEZI JUU" & q4_lg == "MBEZI JUU"
recode street (.=261) if q5_lg == "MBEZI KATI" & q4_lg == "MBEZI JUU"
recode street (.=262) if q5_lg == "MBEZI MTONI" & q4_lg == "MBEZI JUU"
recode street (.=263) if q5_lg == "NDUMBWI" & q4_lg == "MBEZI JUU"
recode street (.=264) if q5_lg == "BARAFU" & q4_lg == "MBURAHATI"
recode street (.=265) if q5_lg == "KISIWANI" & q4_lg == "MBURAHATI"
recode street (.=266) if q5_lg == "NHC" & q4_lg == "MBURAHATI"
recode street (.=267) if q5_lg == "MAPUTO" & q4_lg == "MBWENI"
recode street (.=268) if q5_lg == "MBWENI" & q4_lg == "MBWENI"
recode street (.=269) if q5_lg == "MPIJI" & q4_lg == "MBWENI"
recode street (.=270) if q5_lg == "KITUMBINI" & q4_lg == "MCHAFUKOGE"
recode street (.=271) if q5_lg == "MCHAFUKOGE" & q4_lg == "MCHAFUKOGE"
recode street (.=272) if q5_lg == "ILALA KOTA" & q4_lg == "MCHIKICHINI"
recode street (.=273) if q5_lg == "MISSION QUARTER" & q4_lg == "MCHIKICHINI"
recode street (.=274) if q5_lg == "MSIMBAZI BONDENI" & q4_lg == "MCHIKICHINI"
recode street (.=275) if q5_lg == "ALLY HASSAN MWINYI" & q4_lg == "MIKOCHENI"
recode street (.=276) if q5_lg == "DARAJANI" & q4_lg == "MIKOCHENI"
recode street (.=277) if q5_lg == "MIKOCHENI A" & q4_lg == "MIKOCHENI"
recode street (.=278) if q5_lg == "MIKOCHENI B" & q4_lg == "MIKOCHENI"
recode street (.=279) if q5_lg == "REGENT ESTATE" & q4_lg == "MIKOCHENI"
recode street (.=280) if q5_lg == "TPDC" & q4_lg == "MIKOCHENI"
recode street (.=281) if q5_lg == "BONDE LA MPUNGA" & q4_lg == "MSASANI"
recode street (.=282) if q5_lg == "MAKANGIRA" & q4_lg == "MSASANI"
recode street (.=283) if q5_lg == "MASAKI" & q4_lg == "MSASANI"
recode street (.=284) if q5_lg == "MIKOROSHINI" & q4_lg == "MSASANI"
recode street (.=285) if q5_lg == "OYSTERBAY" & q4_lg == "MSASANI"
recode street (.=286) if q5_lg == "KWA YUSUFU" & q4_lg == "MSIGANI"
recode street (.=287) if q5_lg == "MALAMBA MAWILI" & q4_lg == "MSIGANI"
recode street (.=288) if q5_lg == "MSIGANI" & q4_lg == "MSIGANI"
recode street (.=289) if q5_lg == "TEMBONI" & q4_lg == "MSIGANI"
recode street (.=290) if q5_lg == "KIBOGA" & q4_lg == "MSONGOLA"
recode street (.=291) if q5_lg == "KIDOLE" & q4_lg == "MSONGOLA"
recode street (.=292) if q5_lg == "KITONGA" & q4_lg == "MSONGOLA"
recode street (.=293) if q5_lg == "MBONDOLE" & q4_lg == "MSONGOLA"
recode street (.=294) if q5_lg == "MKERA" & q4_lg == "MSONGOLA"
recode street (.=295) if q5_lg == "MVULENI" & q4_lg == "MSONGOLA"
recode street (.=296) if q5_lg == "SANGARA" & q4_lg == "MSONGOLA"
recode street (.=297) if q5_lg == "UWANJA WA NYANI" & q4_lg == "MSONGOLA"
recode street (.=298) if q5_lg == "YANGEYANGE" & q4_lg == "MSONGOLA"
recode street (.=299) if q5_lg == "BWAWANI" & q4_lg == "MWANANYAMALA"
recode street (.=300) if q5_lg == "KAMBANGWA" & q4_lg == "MWANANYAMALA"
recode street (.=301) if q5_lg == "KWA KOPA" & q4_lg == "MWANANYAMALA"
recode street (.=302) if q5_lg == "MSISIRI A" & q4_lg == "MWANANYAMALA"
recode street (.=303) if q5_lg == "MSISIRI B" & q4_lg == "MWANANYAMALA"
recode street (.=304) if q5_lg == "MSOLOMI" & q4_lg == "MWANANYAMALA"
recode street (.=305) if q5_lg == "MWINJUMA" & q4_lg == "MWANANYAMALA"
recode street (.=306) if q5_lg == "IDRISSA" & q4_lg == "MZIMUNI"
recode street (.=307) if q5_lg == "MAKUMBUSHO" & q4_lg == "MZIMUNI"
recode street (.=308) if q5_lg == "MTAMBANI" & q4_lg == "MZIMUNI"
recode street (.=309) if q5_lg == "MWINYIMKUU" & q4_lg == "MZIMUNI"
recode street (.=310) if q5_lg == "KAGERA MIKOROSHINI" & q4_lg == "NDUGUMBI"
recode street (.=311) if q5_lg == "MAKANYA" & q4_lg == "NDUGUMBI"
recode street (.=312) if q5_lg == "MPAKANI" & q4_lg == "NDUGUMBI"
recode street (.=313) if q5_lg == "VIGAENI" & q4_lg == "NDUGUMBI"
recode street (.=314) if q5_lg == "BANGULO" & q4_lg == "PUGU"
recode street (.=315) if q5_lg == "BOMBANI" & q4_lg == "PUGU"
recode street (.=316) if q5_lg == "KICHANGANI" & q4_lg == "PUGU"
recode street (.=317) if q5_lg == "KIGOGO FRESH" & q4_lg == "PUGU"
recode street (.=318) if q5_lg == "KINYAMWEZI" & q4_lg == "PUGU"
recode street (.=319) if q5_lg == "PUGU STATION" & q4_lg == "PUGU"
recode street (.=320) if q5_lg == "KIMARA B" & q4_lg == "SARANGA"
recode street (.=321) if q5_lg == "KING'ONGO" & q4_lg == "SARANGA"
recode street (.=322) if q5_lg == "MATANGINI" & q4_lg == "SARANGA"
recode street (.=323) if q5_lg == "MICHUNGWANI" & q4_lg == "SARANGA"
recode street (.=324) if q5_lg == "SARANGA" & q4_lg == "SARANGA"
recode street (.=325) if q5_lg == "STOPOVER" & q4_lg == "SARANGA"
recode street (.=326) if q5_lg == "UPENDO" & q4_lg == "SARANGA"
recode street (.=327) if q5_lg == "AMANI" & q4_lg == "SEGEREA"
recode street (.=328) if q5_lg == "LIWITI" & q4_lg == "SEGEREA"
recode street (.=329) if q5_lg == "MIGOMBANI" & q4_lg == "SEGEREA"
recode street (.=330) if q5_lg == "SEGEREA" & q4_lg == "SEGEREA"
recode street (.=331) if q5_lg == "UGOMBOLWA" & q4_lg == "SEGEREA"
recode street (.=332) if q5_lg == "SINZA A" & q4_lg == "SINZA"
recode street (.=333) if q5_lg == "SINZA B" & q4_lg == "SINZA"
recode street (.=334) if q5_lg == "SINZA C" & q4_lg == "SINZA"
recode street (.=335) if q5_lg == "SINZA D" & q4_lg == "SINZA"
recode street (.=336) if q5_lg == "SINZA E" & q4_lg == "SINZA"
recode street (.=337) if q5_lg == "MANDELA" & q4_lg == "TABATA"
recode street (.=338) if q5_lg == "MATUMBI" & q4_lg == "TABATA"
recode street (.=339) if q5_lg == "MSIMBAZI" & q4_lg == "TABATA"
recode street (.=340) if q5_lg == "TABATA" & q4_lg == "TABATA"
recode street (.=341) if q5_lg == "TABATA KISIWANI" & q4_lg == "TABATA"
recode street (.=342) if q5_lg == "TENGE" & q4_lg == "TABATA"
recode street (.=343) if q5_lg == "KWA MKUNDUGE" & q4_lg == "TANDALE"
recode street (.=344) if q5_lg == "KWA MTOGOLE" & q4_lg == "TANDALE"
recode street (.=345) if q5_lg == "KWA PAKACHA" & q4_lg == "TANDALE"
recode street (.=346) if q5_lg == "KWA TUMBO" & q4_lg == "TANDALE"
recode street (.=347) if q5_lg == "MUHALITANI" & q4_lg == "TANDALE"
recode street (.=348) if q5_lg == "SOKONI" & q4_lg == "TANDALE"
recode street (.=349) if q5_lg == "CHUO KIKUU" & q4_lg == "UBUNGO"
recode street (.=350) if q5_lg == "KIBO" & q4_lg == "UBUNGO"
recode street (.=351) if q5_lg == "KISIWANI" & q4_lg == "UBUNGO"
recode street (.=352) if q5_lg == "MSEWE" & q4_lg == "UBUNGO"
recode street (.=353) if q5_lg == "NHC" & q4_lg == "UBUNGO"
recode street (.=354) if q5_lg == "MARKAZ" & q4_lg == "UKONGA"
recode street (.=355) if q5_lg == "MAZIZINI" & q4_lg == "UKONGA"
recode street (.=356) if q5_lg == "MONGO LA NDEGE" & q4_lg == "UKONGA"
recode street (.=357) if q5_lg == "MWEMBE MADAFU" & q4_lg == "UKONGA"
recode street (.=358) if q5_lg == "CHARAMBE" & q4_lg == "UPANGA MAGHARIBI"
recode street (.=359) if q5_lg == "FIRE" & q4_lg == "UPANGA MAGHARIBI"
recode street (.=360) if q5_lg == "MFAUME" & q4_lg == "UPANGA MAGHARIBI"
recode street (.=361) if q5_lg == "KIBASILA" & q4_lg == "UPANGA MASHARIKI"
recode street (.=362) if q5_lg == "KITONGA" & q4_lg == "UPANGA MASHARIKI"
recode street (.=363) if q5_lg == "KOMBO" & q4_lg == "VINGUNGUTI"
recode street (.=364) if q5_lg == "MIEMBENI" & q4_lg == "VINGUNGUTI"
recode street (.=365) if q5_lg == "MTAKUJA" & q4_lg == "VINGUNGUTI"
recode street (.=366) if q5_lg == "MTAMBANI" & q4_lg == "VINGUNGUTI"
recode street (.=367) if q5_lg == "KILIMAHEWA" & q4_lg == "WAZO"
recode street (.=368) if q5_lg == "KISANGA" & q4_lg == "WAZO"
recode street (.=369) if q5_lg == "MADALA" & q4_lg == "WAZO"
recode street (.=370) if q5_lg == "MIVUMONI" & q4_lg == "WAZO"
recode street (.=371) if q5_lg == "SALASALA" & q4_lg == "WAZO"
recode street (.=372) if q5_lg == "WAZO" & q4_lg == "WAZO"

recode street (.=334) if regexm(q5_lg,"C") == 1 & q4_lg == "SINZA"
recode street (.=332) if regexm(q5_lg,"A") == 1 & q4_lg == "SINZA"
recode street (.=333) if regexm(q5_lg,"B") & q4_lg == "SINZA"
recode street (.=151) if q5_lg == "ALL MAUA A" & q4_lg == "KIJITONYAMA"
recode street (.=102) if regexm(q5_lg,"MALAPA") & q4_lg == "BUGURUNI"
recode street (.=102) if q5_lg == "BUGURUNI MALADA"
recode street (.=114) if q5_lg == "CHANIKA" & q6 == "VIKONGORO"
recode street (.=115) if q5_lg == "CHANIKA" & q6 == "YONGWE"
recode street (.=276) if regexm(q5_lg, "DALAJANI") & q4_lg == "MIKOCHENI"
recode street (.=276) if q5_lg == "DARAJANI" & q4_lg == "MIKOCFHENI"
recode street (.=276) if regexm(q5_lg, "DARAJANI") & q4_lg == "MIKOCHENI"
recode street (.=276) if q5_lg == "DARJANI" & q4_lg == "MIKOCHENI"
recode street (.=213) if q5_lg == "DOSI" & q4_lg == "MAGOMENI"
recode street (.=143) if q5_lg == "HONDOKO" & q4_lg == "KIBAMBA"
recode street (.=143) if q5_lg == "HONDOKO" & ward == 11
recode street (.=143) if q5_lg == "HONDOGO" & ward == 11
recode street (.=314) if q5_lg == "BANGALO" & ward == 48
recode street (.=314) if q5_lg == "BANGULA" & ward == 48
recode street (.=314) if regexm(q5_lg, "BANGULO") & ward == 48
recode street (.=314) if regexm(q5_lg, "BANGURO") & ward == 48
recode street (.=105) if regexm(q5_lg, "BOKO KATI") & ward == 2
recode street (.=137) if regexm(q5_lg, "MASHARIKI") & ward == 9
recode street (.=135) if regexm(q5_lg, "KASKAZ") & ward == 9
recode street (.=135) if regexm(q5_lg, "KASIKAZ") & ward == 9
recode street (.=179) if regexm(q5_lg, "KATI") & ward == 20
recode street (.=179) if regexm(q5_lg, "KATA") & ward == 20
recode street (.=239) if regexm(q5_lg, "KAGELA") & ward == 33
recode street (.=239) if regexm(q5_lg, "KAGERA") & ward == 33
recode street (.=310) if regexm(q5_lg, "KAGERA") & ward == 47
recode street (.=174) if regexm(q5_lg, "KALAKATA") & ward == 18
recode street (.=300) if regexm(q5_lg, "KAMBANGWA") & ward == 45
recode street (.=230) if regexm(q5_lg, "KIBANGU") & ward == 31
recode street (.=361) if q5_lg == "9999999" & ward == 57 & q2 == "SAUDA ADDEY"
recode ward (19=57) if q5_lg == "KIBASILA" & q2 == "SAUDA ADDEY"
recode street (.=361) if q5_lg == "KIBASILA" & ward == 57
recode street (.=361) if q5_lg == "179" & ward == 57 & q2 == "SAUDA ADDEY"
recode street (.=145) if regexm(q5_lg, "KIBWEGELE") & ward == 11
recode street (.=145) if regexm(q5_lg, "KIBWEGELA") & ward == 11
recode street (.=145) if regexm(q5_lg, "KIBWEGERE") & ward == 11
recode street (.=218) if regexm(q5_lg, "KICHAN") & ward == 29
recode street (.=291) if regexm(q5_lg, "KIDO") & ward == 44
recode street (.=219) if regexm(q5_lg, "KIGEZI") & ward == 29
recode street (.=189) if regexm(q5_lg, "KIGILAG") & ward == 23
recode street (.=317) if regexm(q5_lg, "KIGOGO") & ward == 48
recode street (.=240) if regexm(q5_lg, "KILIMA") & ward == 33
recode street (.=157) if regexm(q5_lg, "DARAJANI") & ward == 14
recode street (.=109) if regexm(q5_lg, "KIMWAN") & ward == 3
recode street (.=321) if regexm(q5_lg, "KING") & ward == 49
recode street (.=175) if regexm(q5_lg, "KIPUNGUNI") & ward == 18
recode street (.=341) if regexm(q5_lg, "KISIWANI") & ward == 52

recode ward (.=57) if regexm(q4_lg, "UPANGA") & q5_lg == "KITONGA"
recode ward (.=57) if regexm(q4_lg, "9999999") & q5_lg == "KITONGA"

recode street (.=362) if regexm(q5_lg, "KITONGA") & ward == 57
recode street (.=318) if regexm(q5_lg, "KMWEZI") & ward == 48
recode street (.=234) if regexm(q4_lg, "KISIWANI") & ward == 32
recode street (.=344) if regexm(q5_lg, "MTOGOLE") & ward == 53
recode street (.=110) if regexm(q5_lg, "LUBAKAYA") & ward == 3
recode street (.=110) if regexm(q5_lg, "LUGAKAYA") & ward == 3
recode street (.=110) if regexm(q5_lg, "LUKABAYA") & ward == 3
recode street (.=111) if regexm(q5_lg, "LUKOONO") & ward == 3
recode street (.=357) if regexm(q5_lg, "MADAFU") & ward == 55
recode street (.=211) if regexm(q5_lg, "MABWE") & ward == 27
recode street (.=369) if regexm(q5_lg, "MADALE") & ward == 59
recode street (.=369) if regexm(q5_lg, "MADDALE") & ward == 59
recode street (.=129) if regexm(q5_lg, "MAFULIKO") & ward == 7
recode street (.=136) if regexm(q5_lg, "MAGHA") & ward == 9
recode street (.=230) if regexm(q4_lg, "KIBANGU") & ward == 31
recode street (.=365) if regexm(q5_lg, "MAKUJA") & ward == 58
recode street (.=215) if q5_lg == "MAKUTI A.UTENGULE" & ward == 28
recode street (.=216) if q5_lg == "MAKUTI B LIMBENI" & ward == 28
recode street (.=337) if regexm(q5_lg, "MANDELE") & ward == 52
recode street (.=267) if regexm(q5_lg, "MAPUTO") & ward == 38
recode street (.=354) if regexm(q5_lg, "MARKA") & ward == 55
recode street (.=133) if q5_lg == "MATAMBANI A" & ward == 8
recode street (.=221) if regexm(q5_lg, "MGEULE") & ward == 29
recode street (.=243) if regexm(q5_lg, "MIANZI") & ward == 33
recode street (.=364) if regexm(q5_lg, "MIEMBENI") & ward == 58
recode street (.=277) if q5_lg == "MIKOCHENI 'A'" & ward == 41
recode street (.=277) if q5_lg == "MIKOCHENI-A" & ward == 41
recode street (.=278) if q5_lg == "MIKOCHONI B" & ward == 41
recode street (.=284) if q5_lg == "MIKOROSHONI" & ward == 42
recode street (.=284) if q5_lg == "MIKOROSHINI" & ward == 42
recode street (.=238) if q5_lg == "MINAZU" & ward == 32
recode street (.=273) if regexm(q5_lg, "MISSION") & ward == 40
recode street (.=222) if regexm(q5_lg, "MJI") & ward == 29
recode street (.=294) if regexm(q5_lg, "MKELA") & ward == 44
recode street (.=125) if q5_lg == "MKUNGUNI-A" & ward == 6
recode street (.=126) if q5_lg == "MKUNGUNI-B" & ward == 6
recode street (.=148) if regexm(q5_lg, "MKWAJUNI") & ward == 12
recode street (.=246) if regexm(q5_lg, "MLIMANI") & ward == 34
recode street (.=131) if regexm(q5_lg, "MNAZI MM") & ward == 8
recode street (.=154) if q5_lg == "MPAKANIA" & ward == 13
recode street (.=339) if q5_lg == "MSIMBA" & ward == 52
recode street (.=274) if q5_lg == "MSIMBAZI" & ward == 40
recode street (.=274) if q5_lg == "MSIMBAZI BODENI" & ward == 40
recode street (.=303) if q5_lg == "MSISIRI B" & ward == 45
recode street (.=366) if regexm(q5_lg, "MTAMBA") & ward == 58
recode street (.=366) if regexm(q5_lg, "MTABANI") & ward == 58
recode street (.=178) if regexm(q5_lg, "MTEND") & ward == 19
recode street (.=249) if regexm(q5_lg, "MUUNGANO") & ward == 34
recode street (.=356) if q5_lg == "MWANDEGE" & ward == 55
recode street (.=305) if regexm(q5_lg, "MWINYINJUMA") & ward == 45
recode street (.=305) if regexm(q5_lg, "MWINYIJUMA") & ward == 45
recode street (.=305) if regexm(q5_lg, "MWINYIMVUA") & ward == 45
recode street (.=233) if q5_lg == "MWOGOZO" & ward == 31
recode street (.=180) if q5_lg == "MZINGI" & ward == 20
recode street (.=355) if q5_lg == "MZIZINI" & ward == 55
recode street (.=140) if q5_lg == "Mzimuni" & ward == 10

recode ward (.=44) if q4_lg == "SONGOLA"

recode street (.=297) if q5_lg == "NYANI" & ward == 44
recode street (.=223) if regexm(q5_lg, "NYEBU") & ward == 29
recode street (.=223) if regexm(q5_lg, "NYEBE") & ward == 29
recode street (.=223) if regexm(q5_lg, "NYEMBU") & ward == 29
recode street (.=285) if regexm(q5_lg, "OSTARBAY") & ward == 42
recode street (.=285) if regexm(q5_lg, "OSTARBEY") & ward == 42
recode street (.=345) if regexm(q5_lg, "PAKACHA") & ward == 53
recode street (.=317) if q6 == "KIGOGO FRESHI" & ward == 48
recode street (.=279) if regexm(q5_lg, "REGENC") & ward == 41
recode street (.=279) if q5_lg == "REGENT" & ward == 41
recode street (.=296) if regexm(q5_lg, "SANGALA") & ward == 44
recode street (.=182) if regexm(q5_lg, "SEAVIEW") & ward == 21
recode street (.=130) if regexm(q5_lg, "SHARIFU") & ward == 7
recode street (.=130) if regexm(q5_lg, "SHAFU SHAMBA") & ward == 7
recode street (.=244) if regexm(q5_lg, "SISI KWA SISI") & ward == 33
recode street (.=319) if q5_lg == "STATION" & ward == 48

recode ward (15=49) if q2 == "SIAEL NGOWO" & q5_lg == "STOP OVER"

recode street (.=325) if regexm(q5_lg, "STOP") & ward == 49
recode street (.=325) if q5_lg == "SYOP OVER" & ward == 49
recode street (.=160) if regexm(q5_lg, "TEMBO MGWAZA") & ward == 14
recode street (.=289) if regexm(q5_lg, "TEMBONI") & ward == 43
recode street (.=113) if regexm(q5_lg, "TUNGIN") & ward == 3
recode street (.=297) if regexm(q5_lg, "NJANI") & ward == 44
recode street (.=297) if regexm(q5_lg, "UWANJA") & ward == 44
recode street (.=353) if regexm(q5_lg, "N.H.C") & ward == 54
recode street (.=353) if regexm(q5_lg, "NHC") & ward == 54
recode street (.=353) if q5_lg == "UBUNGO" & ward == 54 & q2 == "DALINI ABDUL"
recode street (.=134) if q5_lg == "UKOMBOZI" & ward == 8
recode street (.=114) if q5_lg == "VIKONGORO" & ward == 3
recode street (.=365) if q4_lg == "MTAKUJA" & ward == 58
recode street (.=298) if q5_lg == "YANGE YANGE" & ward == 44
recode street (.=332) if q5_lg == "a" & ward == 51
recode street (.=153) if q5_lg == "kijitonyama" & ward == 13

recode ward (.=7) if district == 1 & q5_lg == "ILALA" & q4_lg == "MAFULIKO" 
recode street (.=129) if q5_lg == "ILALA" & q4_lg == "MAFULIKO" 

*Assuming "G/Mboto" should be it's own ward, cleaning ward and street here
lab def ward 60 "G/Mboto", add
lab def street 373 "Bumila" 374 "Kwa lala" 375 "Ulongoni", add
recode ward (.=60) if regexm(q4_lg, "MBOTO") & district == 1
recode ward (.=60) if regexm(q3_lg, "MBOTO") & district == 1
recode ward (.=60) if regexm(q5_lg, "MBOTO") & district == 1

recode street (.=373) if regexm(q5_lg, "BUMILA") & ward == 60
recode street (.=374) if regexm(q5_lg, "KWALALA") & ward == 60
recode street (.=374) if regexm(q4_lg, "KWALALA") & ward == 60
recode street (.=375) if regexm(q5_lg, "ULONGONI") & ward == 60
recode street (.=375) if regexm(q4_lg, "ULONGONI") & ward == 60
recode street (.=375) if regexm(q5_lg, "URONGONI") & ward == 60

recode ward (.=32) if q2 == "HADIJA MUSSA MABULA" & q4_lg == "MABULA" & q5_lg == "MCHANGANI"
recode street (.=237) if q2 == "HADIJA MUSSA MABULA" & q4_lg == "MABULA" & q5_lg == "MCHANGANI"

recode ward (.=33) if q4_lg == "MIANZANI" & q2 == "CATHERENE MEZA"
recode street (.=243) if q4_lg == "MIANZANI" & q2 == "CATHERENE MEZA"

recode ward (16=28) if q3_lg == "MAGOMENI" & q5_lg == "IDRISA"
recode street (.=214) if q5_lg == "IDRISA" & ward == 28
recode street (.=214) if q5_lg == "1DRISA" & ward == 28

recode ward (.=34) if q4_lg == "MVULENI" & q2 == "JOYCE KAMGUNA"
recode street (.=250) if q4_lg == "MVULENI" & ward == 34

recode ward (.= 48) if q4_lg == "PIGI"

recode street (.=163) if q5_lg == "KILUNGULE ''A''"
recode street (.=163) if q5_lg == "KILUNGULE" & q2 == "CALORINE MAHONDO"
recode street (.=163) if q5_lg == "KILUNGULE" & q2 == "CAROLINE TITUS MHANDO"
recode street (.=164) if q5_lg == "KILUNGULE" & regexm(q2, "MAGRETH")
recode street (.=164) if q5_lg == "KILUNGURE" & regexm(q2, "MAGRETH")
recode street (.=254) if q5_lg == "MBEZI" & regexm(q2, "ELIPHE")
recode street (.=124) if q5_lg == "KISUTU" & ward == 6
recode street (.=312) if q5_lg == "MPAKANI" & ward == 47
recode street (.=116) if q4_lg == "ZINGIZIWA" & ward == 3

recode ward (46=34) if q5_lg == "KILIMANI" & q2 == "SUZANA MSANGI"
recode street (.=246) if q5_lg == "KILIMANI" & ward == 34
recode street (.=322) if ward == 49 & q2 == "REGINA .P. MLAWA"
recode street (.=138) if q5_lg == "MBEZI BEACH" & q2 == "RADHIA YUSUPH"
recode street (.=138) if q5_lg == "MBEACH A" & q2 == "RADHIA YUSUPH"
recode street (.=213) if q5_lg == "BOSI" & ward == 28
recode street (.=242) if q5_lg == "KWAJONGO" & ward == 33
recode street (.=172) if q2 == "NURU LIKWATA" & ward == 17 & q5_lg == "KI"
recode street (.=171) if q2 == "NURU LIKWATA" & ward == 17
recode street (.=151) if q5_lg == "ALL MAUA" & q2 == "NASRA GAUDENS SAUL"
recode street (.=151) if q5_lg == "ALI MAUA" & q2 == "NASRA GAUDENS SAUL"
recode street (.=375) if q5_lg == "ULANGONI" & ward == 60
recode street (.=375) if q5_lg == "ULONGO" & ward == 60
recode street (.=276) if q5_lg == "ALI HASSANI MWINYI" & ward == 41
recode street (.=146) if q5_lg == "KILUVYA" & ward == 11
recode street (.=143) if q5_lg == "KONDOGO" & ward == 11

*added 2015.02.10
recode street (.=196) if q5_lg == "MBWENI" & ward == 24 & q2 == "SOPHIA KILINDO"
recode street (.=318) if q5_lg == "KIMWELI" & ward == 48 
recode street (.=318) if q5_lg == "KIMWEZI" & ward == 48 

recode ward (.=7) if q2 == "MARIAM LUBAWA" & q4_lg == "VINGUNGUTI ILALA"

recode street (.=135) if q4_lg == "K-KASKAZIN"
recode street (.=315) if q4_lg == "BOMBANI"
recode street (.=218) if q4_lg == "KICHANGANI"
recode street (.=222) if q4_lg == "MJI MPYA" & ward == 29
recode street (.=222) if q4_lg == "MJIMPYA" & ward == 29
recode street (.=107) if q4_lg == "DOVYA"
recode street (.=179) if q4_lg == "KITUNDA KATI"
recode street (.=297) if q4_lg == "U/NJANI" & ward == 44
recode street (.=292) if q4_lg == "KITONGA" & ward == 44
recode street (.=324) if q4_lg == "SALANGA" & ward == 49
recode street (.=102) if q4_lg == "BUGURUNI MALAPA" & ward == 1
recode street (.=102) if q5_lg == "B/MARAPA" & ward == 1
recode street (.=315) if q5_lg == "BOMBANI" & ward == 48
recode street (.=315) if q5_lg == "BOMBATI" & ward == 48
recode street (.=107) if q5_lg == "DONYA" & ward == 2
recode street (.=117) if q5_lg == "GEREZANI/MAGHARIBI" & ward == 4
recode street (.=131) if q4_lg == "MNAZI MMOJA" & ward == 8
recode street (.=205) if q5_lg == "JITEGEME" & ward == 26
recode street (.=144) if q5_lg == "KIABAMBA" & ward == 11
recode street (.=241) if q5_lg == "KIBAMBA" & ward == 33
recode street (.=241) if q5_lg == "KIMAMBA" & ward == 33
recode street (.=158) if q5_lg == "KIMANGA" & ward == 14
recode street (.=109) if q5_lg == "KIMKIANI" & ward == 3
recode street (.=100) if q5_lg == "KIWALANI" & ward == 1
recode street (.=223) if q5_lg == "KIJERU" & ward == 29
recode street (.=277) if q5_lg == "MIKOCHENI" & ward == 41 & q2 == "AGNESS MLANZI" 
recode street (.=277) if q5_lg == "MIKOCHENI" & ward == 41 & q2 == "AGNESS MILANZIi"
recode street (.=277) if q5_lg == "MIKOCHENI" & ward == 41 & q2 == "AGNES MILANZI" 
recode street (.=290) if q5_lg == "9999999" & ward == 44 & q2 == "AGRIPINA NICOLAUS" 
recode street (.=133) if q5_lg == "MTAMBANI-A" & ward == 8
recode street (.=296) if q5_lg == "SANGANI" & ward == 44
recode street (.=211) if q5_lg == "MABULE PANDE" & ward == 27
recode street (.=125) if q5_lg == "MKUNGUNI" & ward == 6 & q2 == "DARLIN KOMBO" & ID == "0701/32/09/17"
recode street (.=126) if q5_lg == "MKUNGUNI" & ward == 6 & q2 == "DARLIN KOMBO"
recode street (.=126) if q5_lg == "MMKUNGUNGUNI" & ward == 6 & q2 == "DARLIN KOMBO"
recode street (.=222) if q5_lg == "ILALA" & ward == 29 & q2 == "DEVOTHA FRANCIS"
recode street (.=284) if q5_lg == "MKOROSHINI" & ward == 42
recode street (.=114) if q4_lg == "VIKONGORO" & ward == 3
recode street (.=294) if q5_lg == "MELA" & ward == 44
recode ward (.=19) if q5_lg == "KISUTU" & ID == "0702/048/01/04"
recode street (.=177) if q5_lg == "KISUTU" & ID == "0702/048/01/04"
recode street (.=250) if q5_lg == "NDUGUMBI" 
recode street (.=153) if q5_lg == "KIJITONYMA" & ward == 13
recode street (.=314) if q5_lg == "PUGU MSIMBAZI" & ward == 48 & ID == "0702/31/18/14"
recode street (.=140) if q5_lg == "MZOMONI" & ward == 10
recode street (.=363) if q5_lg == "9999999" & ward == 58 & q2 == "MAGRETH KATUMIA"
recode street (.=279) if ward == 41 & ID == "0701/04/05/22"
recode street (.=348) if ward == 53 & ID == "0701/08/03/08"
recode street (.=348) if ward == 53 & ID == "0701/08/03"
recode ward (16=53) if q5_lg == "TANDALE" & ID == "0701/08/03/03"
recode street (.=348) if q5_lg == "TANDALE" & ID == "0701/08/03/03"
recode street (.=276) if ward == 41 & ID == "FS186/02"
recode ward (55=60) if q5_lg == "URONGONI" & ID == "0702/23/02/024"
recode street (.=375) if q5_lg == "URONGONI" & ID == "0702/23/02/024"
recode street (.=373) if ward == 60 & ID == "702/23/03/13"
recode street (.=141) if ward == 10 & q5_lg == "KWAMANI"
recode street (.=171) if ward == 17 & ID == "0702/13/01/22"
recode street (.=345) if ward == 53 & q6 == "PAKACHA"
recode street (.=309) if ward == 46 & ID == "0710/20/04/12"
recode street (.=362) if ward == 57 & ID == "0702/42/01/16"
recode street (.=131) if ward == 8 & ID == "0702/09/03/21"
recode street (.=196) if ward == 24 & ID == "0701/22/04/13"
recode street (.=226) if ward == 30 & ID == "0701/22/04/07"
recode street (.=274) if ward == 40 & ID == "0702/47/02/07"

*****Updated on March 14 from Eric's email on Feb 17
**There was an additional street that was not included in the initial codebook
** Adding here 
recode street (.=226) if q5_lg == "CCM" & ward == 30
recode street (.=215) if q5_lg == "KISANGILE" & ward == 28
recode street (.=215) if q5_lg == "FUNDIKILA" & ward == 28
recode street (.=216) if q5_lg == "LIMBENI" & ward == 28
recode street (.=355) if q5_lg == "MAZIZINI" & ward == 55
recode street (.=236) if q5_lg == "MBUTUNI" & ward == 32
recode street (.=154) if ID == "701/01/06/20" | ID == "701/01/06/18" ///
	| ID == "701/01/06/17" | ID == "701/01/06/15"
recode street (.=319) if regexm(q5_lg, "KILUMBA STATION") & ward == 48
recode street (.=319) if regexm(q5_lg, "KINUMBA STATION") & ward == 48
recode street (.=319) if regexm(q5_lg, "KILUMBA KIEMBE") & ward == 48
recode street (.=319) if regexm(q5_lg, "KILUMBA PUGU KIEMBE") & ward == 48
recode ward (16=51) if q5_lg == "SINZA" & q6 == "SINZA C"
recode street (.=334) if q5_lg == "SINZA" & ward == 51 & q6 == "SINZA C"
recode street (.=370) if q5_lg == "KIZUNGA" & ward == 59
*recode street (.=119) if q5_lg == "KIBURURU" & ward == 5
recode ward (33=28) if ID == "0701/09/03/03"
recode street (.=213) if ID == "0701/09/03/03"
recode street (.=213) if ID == "0701/04/03/05"
recode street (.=119) if q5_lg == "CHAULEMBO" & ward == 5
recode ward (16=11) if ID == "0701/18/05/00/19"
recode street (.= 146) if ID == "0701/18/05/00/19"
recode street (.= 175) if ID == "0702/11/02/11"
recode street (.= 175) if ID == "0702/44/08/12"
recode street (.= 150) if ID == "0701/22/06/18"
recode street (.= 150) if ID == "0701/22/06/11"


***Updated on November 9, 2015 from Eric's additional collection from the raw data (Excel spreadsheet.
**Streets and wards
	recode street (.=143) if ID == "0701/18/05/10"
	recode street (.=136) if ID == "0702/09/03/14"
	recode ward (8=9) if ID == "0702/09/03/14"
	recode street (.=272) if q5_lg == "KOTA" & ward == 7
	recode ward (7=40) if street == 272
	recode street (.=372) if ID == "0701/12/04"
	recode street (.=130) if ID == "0702/44/06/02"
	recode ward (40=7) if ID == "0702/44/06/02"
	recode street (.=286) if regexm(q5_lg, "YUSUPH") | regexm(q5_lg, "YUSUFU")
	***EML: note that the ward needs to be fixed for Kwa Yusufu once we hear back from Eric

**Place of delivery (previous code)
	tolgstn q23
	recode q23 (.=1) if q23_lg == "1"
	recode q23 (.=2) if q23_lg == "2"
	recode q23 (.=3) if q23_lg == "3"
	recode q23 (.=3) if q23_lg == "AMANA"
	recode q23 (.=3) if q23_lg == "KITUO CHA AFYA"
	recode q23 (.=3) if q23_lg == "MHIMBOLI"
	recode q23 (.=3) if q23_lg == "SINZA HOSP"
	recode q23 (.=3) if q23_lg == "TUMBI"

 *New code from Nov. 9	
	replace q23 = 1 if ID == "0702/13/01/21"
	replace q23 = 1 if ID == "0702/013/01/01"
	replace q23 = 2 if ID == "0702/23/04/07"
	replace q23 = 3 if ID == "0701/17/01/11"
	replace q23 = 3 if ID == "0701/03/0302"
	replace q23 = 3 if ID == "0701/03/0303"
	replace q23 = 3 if ID == "0701/030307"
	replace q23 = 3 if ID == "0702/20/08/14"
	replace q23 = 3 if ID == "0702/20/08/09"
	replace q23 = 3 if ID == "702/16/08/04"
	replace q23 = 3 if ID == "0701/19/03/06"
	replace q23 = 3 if ID == "0701/04/011/02"
	replace q23 = 3 if ID == "0701/04/11/06"
	replace q23 = 3 if ID == "0702/11/08/04"
	replace q23 = 3 if ID == "0701/12/04/14"
	replace q23 = 3 if ID == "0701/04/18/24"
	replace q23 = 3 if ID == "0701/04/18/20"
	replace q23 = 3 if ID == "0701/20/03"
	replace q23 = 3 if ID == "0701/18/05/00/19"
	replace q23 = 3 if ID == "0701/17/07/13"
	replace q23 = 3 if ID == "0702/13/04/22"
	replace q23 = 3 if ID == "0702/13/04/23"
	replace q23 = 3 if ID == "0702/13/04/18"
	replace q23 = 3 if ID == "0702/44/08/14"
	replace q23 = 3 if ID == "0701/01/03/22"
	replace q23 = 3 if ID == "0702/17/04/4"
	replace q23 = 3 if ID == "0702/17/04/"
	replace q23 = 3 if ID == "0702/17/04/06"
	replace q23 = 3 if ID == "0701/01/03/20"
	replace q23 = 3 if ID == "FS125/06"
	replace q23 = 3 if ID == "0702/23/02/07"
	replace q23 = 3 if ID == "0702/23/02/05"
	replace q23 = 3 if ID == "0701/12/04"
	replace q23 = 3 if ID == "0702/09/03/11"
	replace q23 = 3 if ID == "0702/29/06/18"
	replace q23 = 3 if ID == "0701/24/02/04"
	replace q23 = 3 if ID == "0702/19/05/3"
	replace q23 = 3 if ID == "0702/44/023"
	replace q23 = 3 if ID == "07O2/44/04/20"
	replace q23 = 3 if ID == "0701/32/09/21"
	replace q23 = 3 if ID == "0701/32/09/14"
	replace q23 = 3 if ID == "0702/29/05/1"
	replace q23 = 3 if ID == "0701/07/04/15/"
	replace q23 = 3 if ID == "0702/31/07/08"
	replace q23 = 3 if ID == "0702/09/08/13/"
	replace q23 = 3 if ID == "0702/09/08/16/"
	replace q23 = 3 if ID == "0702/09/08/15/"
	replace q23 = 3 if ID == "FS156/04"
	replace q23 = 3 if ID == "0701/012/02/12"
	replace q23 = 3 if ID == "0702/20/07/16"
	replace q23 = 3 if ID == "0702/17/02/21"
	replace q23 = 3 if ID == "0702/17/04/14"
	replace q23 = 3 if ID == "0702/17/04/11"
	replace q23 = 3 if ID == "0702/17/04/16"
	replace q23 = 3 if ID == "0702/44/07/06"
	replace q23 = 3 if ID == "0701/08/03/01"
	replace q23 = 3 if ID == "0701/08/03/03"
	replace q23 = 3 if ID == "702/16/07/01"
	replace q23 = 4 if ID == "07/01/04/06/12"
	replace q23 = 4 if ID == "FS/147/11"
	replace q23 = 4 if ID == "FS186/03"
	replace q23 = 4 if ID == "0701/04/02/03"
	replace q23 = 4 if ID == "0701/19/03/16"
	replace q23 = 4 if ID == "0702/27/06/03"
	replace q23 = 4 if ID == "0702/11/02/22"
	replace q23 = 4 if ID == "0701/04/11/16"
	replace q23 = 4 if ID == "0702/01/001/0019/019"
	replace q23 = 4 if ID == "0702/40/001/0023/023"
	replace q23 = 4 if ID == "0702/40/001/021"
	replace q23 = 4 if ID == "0701/04/03/20"
	replace q23 = 4 if ID == "0701/26/03/23"
	replace q23 = 4 if ID == "0701/04/11/14"
	replace q23 = 4 if ID == "0701/23/04/17"
	replace q23 = 4 if ID == "0701/32/09/18"
	replace q23 = 4 if ID == "0701/07/02/09"
	replace q23 = 4 if ID == "0701/07/02/05"
	replace q23 = 4 if ID == "0702/29/08/05"
	replace q23 = 4 if ID == "0702/027/002/12"
	replace q23 = 4 if ID == "0702/27/04/21"
	replace q23 = 4 if ID == "0710/07/02/04"
	replace q23 = 5 if ID == "0701/01/03/19"
 

*(previous code)
gen facdel = 0 if q23 ! = .
recode facdel (0=1) if q23 == 3
*Recoding missing facdel if the person clearly recorded a facility for place of birth in question 24
recode facdel (.=1) if regexm(q24, "HOSP")
recode facdel (.=1) if q24 == "MNYAMALA HSP"
recode facdel (.=1) if q24 == "MWANANYAMALA"
recode facdel (.=1) if regexm(q24, "TUMBI")
recode facdel (.=0) if q24 == "NYUMBANI"
recode facdel (.=1) if q24 == "MUHIMBILI"
recode facdel (.=1) if q24 == "AMANA"



***Intervention/control assignment

gen intervention = .
foreach cont in 5 16 24 25 27 28 30 31 32 36 37 38 43 47 51 53 54 56 44 1 23 55 50 39 {    
  recode intervention (.=0) if ward == `cont'
}

foreach int in 2 6 10 11 12 13 15 26 33 34 35 41 42 45 46 49 59 3 4 60 7 8 9 14 17 18 19 20 21 22 29 40 48 52 57 58 {  
  recode intervention (.=1) if ward == `int'
}
replace intervention = 1 if street == 286
lab def intervention 0 "control" 1 "intervention"
lab val intervention intervention
lab var intervention "Ward intervention status for community intervention"
order intervention, before(ward)


***Satisfaction
tolgnum q47
tolgnum q48

destring q47, replace
recode q47 (9999999=.)

destring q48, replace
recode q48 (9999999=.)

lab def satisfied 1 "very dissatisfied" 2 "dissatisfied" 3 "neutral" 4 "satisfied" 5 "very satisfied"
lab val q47 q48 satisfied 

 


***Cleaning age
tolgnum q7
destring q7, replace
recode q7 (9999999=.)
recode q7 (2 3 3.5 5 93 = .)

			**Confirming with Till
			drop if q7 == 14

***Cleaning education
tolgnum q25
destring q25, replace
recode q25 (9999999=.)
lab def edu 0 "pre-primary" 1 "primary" 2 "post-primary" 3 "secondary" 4 "post-secondary" 5 "university"
lab val q25 edu

gen secondaryed = 0 if q25 != .
recode secondaryed (0=1) if q25 >=3
lab def seced 0 "less than secondary ed" 1 "secondary edu or higher"
lab val secondaryed seced
lab var secondaryed "Has secondary education or higher, from q25"
order secondaryed, after(q25)

***Cleaning q30
tolgnum q30
destring q30, replace
recode q30 (9999999=.)
rename q30 q30ynun
lab var q30ynun "Visited by HBC, including unsure responses"
lab def ynun 1 "yes" 2 "no" 3 "unsure"
lab val q30ynun ynun

gen q30 = q30ynun
recode q30 (2=0)
recode q30 (3=.)
lab var q30 "Visited by HBC, unsure recoded to missing"
lab def YesNo 0 "no" 1 "yes"
lab val q30yn YesNo
order q30, before(q30ynun)

rename q30 HBCevervisit
rename q7 age


***Cleaning household members (q26 & q29)
tolgnum q26
destring q26, replace
recode q26 (9999999=.)

tolgnum q29
recode q29 (9999999=.)


****Cleaning ANC variables
tolgnum q12
destring q12, replace
recode q12 (9999999 = .)
recode q12 (3 = .)
recode q12 (2=0)
lab val q12 YesNo

tolgnum q13
recode q13 (9999999 = .)
replace q13=. if q13 >=10

tolgnum q14
recode q14 (9999999 = .)
recode q14 (-5=.)

***Intended place of delivery
tolgnum q21
destring q21, replace
recode q21 (9999999 = .)
lab def q21 1 "At home without a birth attendant" ///
	2 "At home with a birth attendant" ///
	3 "At a healthcare facility" 4 "Upcountry"  5 "Other (specify)"
lab val q21 q21
recode q21 (.=3) if Specify21 == "3"
recode q21 (.=2) if Specify21 == "2"
recode q21 (.=1) if Specify21 == "1"

gen intendfacdel = 0 if q21 !=. & q21 != 5
recode intendfacdel (0=1) if q21 == 3
lab var intendfacdel "From q21, 1 if intends to deliver in facility, 0 if intends to deliver elsewhere"
lab val intendfacdel YesNo
order intendfacdel, before(q21)


lab var age "Age"
lab var secondaryed "Secondary education or higher"
lab var q26 "# adults (>=18) living in the house"
lab var q29 "# children (<18) living in the house"


**Cleaning date of birth
tolgnum q22
replace q22 = date("01sep2013", "DMY") if ID == "0702/97/02/08"
replace q22 = . if q22 == date("09sep1909", "DMY")
replace q22 = . if q22 == date("25feb1909", "DMY")
replace q22 = date("06nov2012", "DMY") if q22 == date("06nov0212", "DMY")
replace q22 = . if q22 <= date("01dec2011", "DMY")
format q22 %td

***Cleaning date of interview
replace q1 = date("15may2014", "DMY") if q1 == date("15may0201", "DMY") 
replace q1 = date("23may2014", "DMY") if q1 == date("23may0204", "DMY") 
replace q1 = . if q1 == date("09sep1909", "DMY") 
replace q1 = date("13may2014", "DMY") if q1 == date("13may1909", "DMY") 
replace q1 = date("15may2014", "DMY") if q1 == date("15may2002", "DMY") 
replace q1 = date("18may2014", "DMY") if q1 == date("18may2002", "DMY")
replace q1 = date("18may2014", "DMY") if q1 == date("18may2004", "DMY") 
replace q1 = date("19may2014", "DMY") if q1 == date("19may2004", "DMY") 
replace q1 = date("23may2014", "DMY") if q1 == date("23may2010", "DMY") 
replace q1 = date("26may2014", "DMY") if q1 == date("26may2011", "DMY") 
replace q1 = date("14may2014", "DMY") if q1 == date("14may2012", "DMY") 
replace q1 = date("16may2014", "DMY") if q1 == date("16may2012", "DMY") 
replace q1 = date("21may2014", "DMY") if q1 == date("21may2012", "DMY") 
replace q1 = date("22may2014", "DMY") if q1 == date("22may2012", "DMY") 

replace q1 = date("08may2014", "DMY") if q1 == date("08may2013", "DMY") 
replace q1 = date("13may2014", "DMY") if q1 == date("13may2013", "DMY") 
replace q1 = date("14may2014", "DMY") if q1 == date("14may2013", "DMY") 
replace q1 = date("15may2014", "DMY") if q1 == date("15may2013", "DMY") 
replace q1 = date("17may2014", "DMY") if q1 == date("17may2013", "DMY") 
replace q1 = date("18may2014", "DMY") if q1 == date("18may2013", "DMY") 
replace q1 = date("19may2014", "DMY") if q1 == date("19may2013", "DMY") 
replace q1 = date("20may2014", "DMY") if q1 == date("20may2013", "DMY") 
replace q1 = date("21may2014", "DMY") if q1 == date("21may2013", "DMY") 
replace q1 = date("23may2014", "DMY") if q1 == date("23may2013", "DMY") 
replace q1 = date("24may2014", "DMY") if q1 == date("24may2013", "DMY") 
replace q1 = date("26may2014", "DMY") if q1 == date("26may2013", "DMY") 

replace q1 = date("13may2014", "DMY") if q1 == date("13may2015", "DMY") 
replace q1 = date("22may2014", "DMY") if q1 == date("22may2015", "DMY") 
replace q1 = date("17may2014", "DMY") if q1 == date("17may2017", "DMY") 
replace q1 = date("13may2014", "DMY") if q1 == date("13may2024", "DMY") 


destring q33, replace


*Cleaning first ANC visit date
replace q15 = . if q15 == td(17jan1909) | q15 == td(30jun1909) | q15 == td(09sep1909) | q15 == td(09may2001) | q15 == td(11jan2015) | q15 == td(14apr2015)
replace q15 = td(07sep2013) if q15 == td(07sep0213)
replace q15 = td(18dec2013) if q15 == td(18dec0213)
replace q15 = td(15apr2012) if q15 == td(15apr2912)
replace q15 = td(01dec2012) if q15 == td(01dec3012)

**Proportion of women who are pregnant versus delivered recently
	tab q33
	gen currentpreg = 1 if q33 == 2
	recode currentpreg (.=0) if q33 == 3
	recode currentpreg (.=0) if q22 > td(01jun2012) & q22 < td(01jun2014)
	recode currentpreg (.=0) if q15 < td(01sep2013) & q15 >= td(01oct2011)
	recode currentpreg (.=3) if q15 >= td(01sep2013) & q15 <= td(01jun2014)
	recode currentpreg (.=2) if q33 == 1
	recode currentpreg (.=4)
	lab def currentpreg 1 "Pregnant" 0 "Recently delivered" 2 "Stated not eligible (and no dates to suggest otherwise)" 3 "Unclear, but look eligible from reported dates" 4 "Unclear, missing dates or out of range"
	lab val currentpreg currentpreg
	tab currentpreg, mi

		**Knowledge CLEANING

foreach var in q37 q38 q39 q40 q41 q42 q43 q44 {
  rename `var' `var'_lg
  gen `var' = `var'_lg
  destring `var', replace
  recode `var' (9999999 = .)
  local vlab: var label `var'_lg
  lab var `var'_lg "Legacy: `vlab'"
  lab var `var' "`vlab'"
  order `var', before(`var'_lg)
}		

*Labeling values for each question
lab def q37 1 "Before 4 months" 2 "At 4-5 months" 3 "At 6-7 months" 4 "At 8-9 months"
lab val q37 q37

lab def q38 1 "One" 2 "Two" 3 "Three" 4 "Four times or more"
lab val q38 q38

lab def q39 1 "Yes" 2 "No" 3 "Don't know"
lab val q39 q39

lab def q40 1 "Trans from HIV + Mom mother not on ARV-preg" ///
	2 "Mosquito bites" 3 "Trans from HIV + Mom mother not on ARV-breastfeeding" ///
	4 "Not sleeping enough" 5 "Hot weather" ///
	6 "Trans from HIV + Mom mother not on ARV-delivery"
lab val q40 q40

lab def q41 1 "Alone at home" 2 "At home with a traditional birth attendant" ///
	3 "At a health facility" 4 "Don't know"
lab val q41 q41

lab def q42 1 "Feeding of forumula milk" 2 "Exclusive breastfeed" ///
	3 "Feeding of soft foods" 4 "A mix of breastfeeding, formula, and/or soft"
lab val q42 q42

lab def q43 1 "Yes" 2 "No" 3 "Undecided"
lab val q43 q43

lab def correct 1 "Correct" 0 "Incorrect"

program correct 
 local vlab: var label `1'
 lab var `1'c "Correct: `vlab'"
 lab val `1'c correct
 order `1'c, after(`1')
end
		
**Missingness for knowledge questions:
mdesc q37 q38 q39 q40 q41 q42 q43 q44 if street != .

*37.	For your understanding; at how many months of pregnancy should a woman attend her first ANC visit?		
tab q37
gen q37c = 0 if q37 >= 2 & q37 <= 4
recode q37c (.=1) if q37 == 1
correct q37
tab q37c
		
		
*38. How many times should a woman attend ANC during her pregnancy?		
tab q38
gen q38c = 0 if q38 >= 1 & q38 <= 3
recode q38c (.=1) if q38 == 4
correct q38
tab q38c		

*39. Is it possible for a baby to be born HIV-positive?		
tab q39
gen q39c = 0 if q39 > 1 & q39 <= 3
recode q39c (.=1) if q39 == 1
correct q39
tab q39c	
		
*40. If yes, what do you think are the reasons for which babies become infected with HIV? (tick all correct options)		
	**NOTE: This question should be "choose all that apply", but the responses
	 *		are coded so that only one is selected per person. This variable
	 *		probably needs to be reentered from the paper forms
	 
tab q40
gen q40c = 0 if q40 == 2 | q40 == 4 | q40 == 5
recode q40c (.=1) if q40 == 1 | q40 == 3 | q40 == 6
correct q40
tab q40c

*41. Where is it recommended for a pregnant woman to deliver? (tick the best option)
tab q41
gen q41c = 0 if q41 == 1 | q41 == 2 | q41 == 4
recode q41c (.=1) if q41 == 3
correct q41
tab q41c
	
*42. What feeding method is recommended for newborns for the first 6 months after delivery? (tick the best option)
tab q42
gen q42c = 0 if q42 == 1 | q42 == 3 | q42 == 4
recode q42c (.=1) if q42 == 2
correct q42
tab q42c		
		
*43. Do you think pregnant women should get tested for HIV?		
tab q43
gen q43c = 0 if q43 == 2 | q43 == 3
recode q43c (.=1) if q43 == 1
correct q43
tab q43c		
		
*44. If yes, why?
	/***NOTE: Elysia's not convinced that there wasn't some response bias with 
			this question (women picking the first response without listening 
			to all options, particularly the final "All of the above" option*/
tab q44

				
foreach var in q37c q38c q41c q43c {
		
		tab intervention `var', row
		**Adding in covariates
		logistic `var' intervention, cluster(street)
	 	glm `var' intervention, fam(bin) link(log) eform robust cluster(street) difficult search

	}

				

**Creating a summary knowledge variable (Addative)
	gen summknowa = q37c + q38c + q39c + q40c + q41c + q42c + q43c
	lab var summknowa "Summary knowledge, adative, from q37 - q43 (max 7)"
	order summknowa, before(q37)
	summ summknowa, detail
	hist summknowa

	**Data are highly positively skewed
		bysort intervention: summ summknowa if street != .


**Creating a summary knowledge variable (PCA)
	pca q37c q38c q39c q40c q41c q42c q43c if street !=.
	scree
	pca q37c q38c q39c q40c q41c q42c q43c if street !=., comp(1)
	predict knowpca
	summ knowpca, detail
	hist knowpca

	**Data are highly positively skewed
		bysort intervention: summ knowpca if street != .


*Reverse coding of variables
	gen facdelr = 1-facdel
	lab def facdelr 0 "Facility delivery - 0" 1 "Home delivery - 1"
	lab val facdelr facdelrev
	lab var facdelr "Home delivery is coded as 1 and facility delivery as 0"	

	foreach var in q37c q38c q39c q41c q42c q43c intendfacdel q12 {
		gen `var'r = 1 - `var'
		local vlab: var label `var'
		lab var `var'r "Reverse code 0 = correct: `vlab'"
		order `var'r, after(`var')
	}


save "$serverpath/crejpop01.dta", replace


//capture log close
//exit

/*
*Exporting missing data for Eric to look into
drop if currentpreg == 2
keep if street == . | (facdel == . & currentpreg !=1)
sort street

keep  ID q1 q2 district q3_lg ward q4_lg street q5_lg q6 age q23 q23_lg q24 q33






